var express = require('express');
var router = express.Router();
var mysql = require("mysql");
var baseDate = require('./mysql.js');

router.get('/', function(req, res, next) {
    return  res.render('sell.html');

});
router.get('/list', function(req, res, next) {
    var $sql = mysql.createConnection(baseDate.mysql);
    $sql.connect();
    var select = "select * from users"   //假设我们数据表叫mono  *代表查询全部内容  select查询
    return  $sql.query(select,function(err,res1){   //err提示错误信息  res是查询到的内容全在里面
           console.log(res1);
        res.send(res1);
    });
    
});



module.exports = router;